#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int a, x, i, k;
    while (scanf("%d", &a) != EOF)
    {
        for (x = 1; x <= a; x++)
        {
            if (x == 1 || x == a)
            {
                i = a;
                while (i)
                {
                    printf("* ");
                    i--;
                }
            }
            else
            {
                printf("* ");
                k = a - 2;
                while (k)
                {
                    printf("  ");
                    k--;
                }
                printf("* ");
            }
            printf("\n");
        }
    }
    return 0;
}